package com.bojiu.lawsearch.lawsearch.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.validation.constraints.NotNull;

/**
 * @Author afdiao
 * @Date 2020/2/25 23:56
 */
@Table(name = "mst_user")
@Data
@ApiModel(value = "前端人员对象", description = "人员明细")
public class WechatUser {
    @ApiModelProperty(value = "人员id", required = false)
    @Column(name = "id")
    @Id
    @GeneratedValue(generator="JDBC")
    private Integer id;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称", required = false)
    @Column(name = "nickname")
    private String nickName;
    /**
     * 头像
     */
    @ApiModelProperty(value = "头像", required = false)
    @Column(name = "headUrl")
    private String headUrl;
    /**
     * 性别
     * 1男
     * 2女
     * 0未知
     */
    @ApiModelProperty(value = "性别 1 男   2女    0未知", required = false)
    @Column(name = "sex")
    private Integer sex;
    /**
     * openid
     */
    @Column(name = "unionid")
    private String unionid;

    @Column(name = "openid")
    private String openid;
    /**
     * 账号
     */
    @ApiModelProperty(value = "手机号", required = true)
    @NotNull(message = "手机号不能为空")
    @Column(name = "account")
    private String account;
    /**
     * 密码
     */
    @ApiModelProperty(value = "密码", required = true)
    @NotNull(message = "密码不能为空")
    @Column(name = "password")
    private String password;

    /**
     * 登录时间
     */
    @Column(name = "loginTime")
    private String loginTime;
    /**
     * 用户类型
     * 0 普通用户
     * 1 工程师
     */
    @ApiModelProperty(value = "用户类型，0普通用户  1工程师", required = true)
    @Column(name = "type")
    private Integer type;

    @ApiModelProperty(value = "省份", required = true)
    @NotNull(message = "省份不能为空")
    @Column(name = "province")
    private String province;

    @ApiModelProperty(value = "市", required = true)
    @NotNull(message = "市不能为空")
    @Column(name = "city")
    private String city;
//
//    /**
//     * 地址
//     */
//    @ApiModelProperty(value = "地址",required = false)
//    @Column(name = "address")
//    private String address;

    /**
     * 删除状态
     * 为空表示有效
     * 1表示删除
     */
    @Column(name = "is_deleted")
    private Integer is_deleted;

    @Transient
    private Engineer engineer;

    /**
     * 在用户注册时返回用户明细时带上token
     */
    @ApiModelProperty(value = "注册后返回新的sign", required = true)
    @Transient
    private String sign;

    @ApiModelProperty(value = "手机验证码", required = true)
    @Transient
    private String phoneCode;

    /**
     * 余额积分信息
     */
    @Transient
    private UserAccount userAccount;

    /**
     * 会员信息状态
     * 1  是会员
     * 2  不是会员
     * 3  是会员已过期
     */
    @ApiModelProperty(value = "会员状态 1已开通会员  2未开通  3会员过期", required = true)
    @Transient
    private Integer memberState;

    @ApiModelProperty(value = "会员说明", required = true)
    @Transient
    private String memberMessage;

    /**
     * 会员有效期截止日  绝对秒数
     */
    @Column(name = "memberTime")
    public String memberTime;

    @ApiModelProperty(value = "会员有效截止时间")
    @Transient
    private String memberDate;

    @Column(name = "goodsId")
    public Integer goodsId;

    @ApiModelProperty(value = "是否申请工程师，1 申请  2  未申请")
    @Transient
    public Integer isApplyEngineer;

    @ApiModelProperty(value = "该用户上家的用户id")
    @Column(name = "extend")
    public Integer extend;

    @Transient
    public String extendUioinId;
}
